<?php

class Application_Form_Article extends Zend_Form
{

    public function init()
    {
          $this->setName('article');
          $this->setAttrib('enctype', 'multipart/form-data');

        $id = new Zend_Form_Element_Hidden('id');
        $id->addFilter('Int');
        
        $reference=new Zend_Form_Element_Text('reference');
        $reference->setLabel('Reference')
        		->setRequired(true)
                ->addFilter('StripTags')
                ->addFilter('StringTrim')
                ->addValidator('NotEmpty');
        
        $gencod = new Zend_Form_Element_Text('gencod');
        $gencod->setLabel('Code Barre')
              ->setRequired(true)
              ->addFilter('StripTags')
              ->addFilter('StringTrim')
              ->addValidator('NotEmpty');
        
        $statut = new Zend_Form_Element_Radio('statut');
        $statut->setLabel('Statut du produit')
        		->setMultiOptions (array('no_statut'=>'Pas de Statut','new'=>'Nouveaute','promo'=>'Promotion','solde'=>'Solde'))
        		->isRequired(true);

        $designation = new Zend_Form_Element_Text('designation');
        $designation->setLabel('Designation')
                ->setRequired(true)
                ->addFilter('StripTags')
                ->addFilter('StringTrim')
                ->addValidator('NotEmpty');
                
        $image= new Zend_Form_Element_File('image');
        $image->setLabel('Image');
        		
                
        $category = new Application_Form_Element_CategorySelect('category');
        $category->setRequired(true)
        		->setLabel('Categorie');
        
        $marque= new Application_Form_Element_MarqueSelect('marque');
        $marque->setRequired(true)
        		->setLabel('Marque');
        		
        $description= new Zend_Form_Element_Textarea('description');
        $description->setRequired(true)
        			->setLabel('Description');

        $price = new Zend_Form_Element_Text('price');
        $price->setLabel('Prix')
              ->setRequired(true)
              ->addFilter('StripTags')
              ->addFilter('StringTrim')
              ->addValidator('NotEmpty');
              
          

        $envoyer = new Zend_Form_Element_Submit('envoyer');
        $envoyer->setAttrib('id', 'boutonenvoyer');

        $this->addElements(array($id,$reference,$gencod,$statut,$category,$marque,$image,$designation,$description, $price, $envoyer));
    }


}

